<?php
echo $this->load->view ( 'header' );
?>
<!--头部开始-->
<div>
	<ul class="breadcrumb">
		<li><a href="<?php echo site_url('menu'); ?>"><?php echo lang('menu_list'); ?></a><span
			class="divider">/</span></li>
		<li><a
			href="<?php echo site_url($this -> config -> item('admin_folder').'menu/form');?>"><?php echo $title; ?></a></li>
	</ul>
</div>
<!--头部结束-->
<?php

if ($this->session->flashdata ( 'message' )) {
	$message = $this->session->flashdata ( 'message' );
}

if ($this->session->flashdata ( 'error' )) {
	$error = $this->session->flashdata ( 'error' );
}

if (function_exists ( 'validation_errors' ) && validation_errors () != '') {
	$error = validation_errors ();
}
?>
		
		<?php if (!empty($message)): ?>
<div class="alert alert-info">
	<a class="close" data-dismiss="alert">×</a>
			<?php echo $message; ?>
		</div>
<?php endif; ?>
						<?php if (!empty($error)): ?>
<div class="alert alert-error">
	<a class="close" data-dismiss="alert">×</a>
			<?php echo $error; ?>
		</div>
<?php endif; ?>

<!--权限开始-->
<div class="row-fluid sortable">
	<div class="box span12">
		<div class="box-header well">
			<h2>
				<i class="icon-edit"></i> <?php echo $title; ?></h2>
			<div class="box-icon">
				<a href="#" class="btn btn-minimize btn-round"><i
					class="icon-chevron-up"></i></a> <a href="#"
					class="btn btn-close btn-round"><i class="icon-remove"></i></a>
			</div>
		</div>
		<div class="box-content">
							<?php
							
							$attributes = array (
									'class' => 'form-horizontal',
									'id' => 'menu_form' 
							);
							echo form_open ( $this->config->item ( 'admin_folder' ) . 'menu/form/' . $id, $attributes );
							?>
						  <fieldset>
				<legend><?php echo lang('hint'); ?></legend>
				<?php
				/*
				 * 无限下拉菜单 <div class="control-group"> <label class="control-label" for="pid"><?php echo lang('menu_pid'); ?></label> <div class="controls"> <?php /* $data = array ( 'id' => 'pid', 'name' => 'pid', 'value' => set_value ( 'pid', $pid ) ); echo form_input ( $data ); ?> <span id="sel_list_show"></span> <span class="help-inline"><?php echo lang('menu_pid_span'); ?></span> </div> </div>
				 */
				?>
			<div class="control-group">
					<label class="control-label" for="pid"><?php echo lang('menu_pid'); ?></label>
                <div class="controls">
					<?php
								$data = array (
										'id' => 'pame',
										'name' => 'pname',
										'value' => set_value ( 'pname', $pname ),
										'readonly' => 'true'

								);
								echo form_input ( $data );
								?>
					<?php
								$data = array (
										'id' => 'pid',
										'name' => 'pid',
										'value' => set_value ( 'pid', $pid ),
										'style' => 'display:none'

								);
								echo form_input ( $data );
								?>
				<span class="help-inline"><?php echo lang('menu_pid_span'); ?></span>
					</div>
				</div>

				<div class="control-group">
					<label class="control-label" for="name_zj"><?php echo lang('menu_name_zh'); ?></label>
					<div class="controls">
							  	<?php
										$data = array (
												'id' => 'name_cn',
												'name' => 'name_cn',
												'value' => set_value ( 'name_zh', $name_cn ) 
										);
										echo form_input ( $data );
										?>
								<span class="help-inline"><i class="icon-star"
							title="<?php echo lang('data_required'); ?>"></i><?php echo lang('menu_name_span_zh'); ?></span>
					</div>
				</div>
				<div class="control-group">
					<label class="control-label" for="name_en"><?php echo lang('menu_name_en'); ?></label>
					<div class="controls">
							  	<?php
										$data = array (
												'id' => 'name_en',
												'name' => 'name_en',
												'value' => set_value ( 'name_en', $name_en ) 
										);
										echo form_input ( $data );
										?>
								<span class="help-inline"><i class="icon-star"
							title="<?php echo lang('data_required'); ?>"></i><?php echo lang('menu_name_span_en'); ?></span>
					</div>
				</div>


				<div class="form-actions">
					<button type="submit" class="btn btn-primary"><?php echo lang('button_save'); ?></button>
				</div>
			</fieldset>
			</form>
		</div>
	</div>
	<!--/box span12-->
</div>
<!--/row-->
<!--/row-->
<?php
echo $this->load->view ( 'footer' );
?>
<?php
/*
 * 无限下拉菜单 <script type="text/javascript" src="<?php echo SITE_ADMIN_JS; ?>/lib_ajax_cate.js"></script> <?php if ($id || $pid) : ?> <script type="text/javascript"> stepless_classification('sel_list_show', 'pid[]', '<?php echo site_url($this -> config -> item('admin_folder').'menu/get_cate') ; ?>/', <?php echo $pid; ?>, '/<?php echo $id; ?>'); </script> <?php else:?> <script type="text/javascript"> stepless_classification('sel_list_show', 'pid[]', '<?php echo site_url($this -> config -> item('admin_folder').'menu/get_cate') ; ?>/', 0); </script> <?php endif;?>
 */
?>
</body>
</html>